package ai.people.netmon.framework.domain.signal.vo;

import ai.people.netmon.framework.domain.signal.entity.SignalUser;
import lombok.Data;

/**
 * @author yuanqinglong
 * @date 2022/4/25 18:19
 */
@Data
public class SignalUserVO {

    public SignalUserVO(SignalUser signalUser){
        this.id = signalUser.getId();
        this.device = signalUser.getDevice();
        this.userName = signalUser.getUserName();
        this.phone = signalUser.getPhone();
        this.firstName = signalUser.getNickName();
        this.metadata = signalUser.getMetadata();
    }

    /**
     * id
     */
    private String id;

    /**
     * 用户名
     * @mock lisa
     */
    private String userName;

    /**
     * 电话
     * @mock 1800000000
     */
    private String phone;

    /**
     * 昵称
     * @mock sali
     */
    private String firstName;

    /**
     * 设备
     * @mock ios
     */
    private String device;

    /**
     * 元数据
     * @mock {"name":"duck"}
     */
    private String metadata;


    /**
     * 构建
     *
     * @param signalUser 信号用户
     * @return {@link SignalUserVO}
     */
    public static SignalUserVO build(SignalUser signalUser){
       return new SignalUserVO(signalUser);
    }
}
